<?php

namespace App\Observers;

use App\Models\GoldCharge;

class GoldChargeObserver
{
	public function creating(GoldCharge $charge)
	{
		if (! $charge->number) {
			$charge->number = serial_number(6, $charge, 'number');
			
			if (! $charge->number) {
				return false; // failed.
			}
		}
	}
}
